package com.yanqu.road.server.cmd.union.cross.trade;

import com.yanqu.road.pb.union.UnionTradeProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_UNION_TRADE_ROUTE_DATA_LOG_LIST, desc = "路线日志")
public class TradeLogDataListCmd extends AbstractCommand {

    private int routeId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        UnionTradeProto.TradeLogDataListReqMsg reqMsg = UnionTradeProto.TradeLogDataListReqMsg.parseFrom(packet.getBytes());
        routeId = reqMsg.getRouteId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {

        player.sendPacket(Protocol.C_UNION_TRADE_ROUTE_DATA_LOG_LIST, UnionTradeProto.TradeLogDataListReqMsg.newBuilder().setRouteId(routeId));

    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
